﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="menu_phai.ascx.cs" Inherits="App_ctr_Admin_menu_phai" %>


<div id="accordion">
</div>

<script>
    function P_MENU(b_kq, ac) {
        var active = (b_kq == "" ? 0 : parseInt(b_kq));
        $(function () {
            try {
                wht_nsd.Fs_MENU(P_MENU_KQ, ErrorDb, ErrorTimeOut);
            }
            catch (e) {
                Msg.Show("Cảnh báo", e.message, "error");
            }


            function P_MENU_KQ(b_kq) {
                if (CheckError(b_kq)) {
                    ShowError(b_kq);
                    return;
                }
                $("#accordion").html(b_kq);

                $("#accordion").accordion({
                    heightStyle: "content",
                    active: active
                });
               
                $("#" + ac).css("background-color", " #DFE8F6");
            }
        });
    }
    function P_MENU_CHON(b_chon) {
        try {
            switch (b_chon) {
                case "THOAT":
                    window.location.assign("../Menu/login.aspx?active=1&id=thoat");
                    break;

                case "TRUONG":
                    window.location.assign("../Danhmuc/dm_truong.aspx?active=1&id=truong");
                    break;
                case "TINH":
                    window.location.assign("../Danhmuc/Tinh.aspx?active=1&id=tinh");
                    break;
                case "HUYEN":
                    window.location.assign("../Danhmuc/Huyen.aspx?active=1&id=huyen");
                    break;
                case "XA":
                    window.location.assign("../Danhmuc/xa.aspx?active=1&id=xa");
                    break;
                case "DANTOC":
                    window.location.assign("../Danhmuc/Dantoc.aspx?active=1&id=dantoc");
                    break;
                case "DTUONG":
                    window.location.assign("../Danhmuc/dtuong.aspx?active=1&id=dtuong");
                    break;
                case "PHONG":
                    window.location.assign("../Danhmuc/phong.aspx?active=1&id=phong");
                    break;

                    //DAO TAO
                case "NAM":
                    window.location.assign("../Daotao/nam.aspx?active=2&id=nam");
                    break;
                case "HTDT":
                    window.location.assign("../Daotao/htdt.aspx?active=2&id=htdt");
                    break;
                case "KHOA":
                    window.location.assign("../Daotao/khoa.aspx?active=2&id=khoa");
                    break;
                case "LOP":
                    window.location.assign("../Daotao/lop.aspx?active=2&id=lop");
                    break;
                case "BOMON":
                    window.location.assign("../Daotao/bomon.aspx?active=2&id=bomon");
                    break;
                case "MON":
                    window.location.assign("../Daotao/monhoc.aspx?active=2&id=mon");
                    break;
                case "DAUNAM":
                    window.location.assign("../Daotao/dau_nam.aspx?active=2&id=daunam");
                    break;
                case "MON_TN":
                    window.location.assign("../Daotao/mon_tn.aspx?active=2&id=mon_tn");
                    break;
                case "GIANGDAY":
                    window.location.assign("../Daotao/pcgiangday.aspx?active=2&id=giangday");
                    break;
                case "TKB":
                    window.location.assign("../Daotao/tkb.aspx?active=2&id=tkb");
                    break;
                case "DKY_LICH_HOC":
                    window.location.assign("../Daotao/dky_lich_hoc.aspx?active=2&id=dky_lich_hoc");
                    break;
                case "NHAPDIEM":
                    window.location.assign("../Daotao/nhapdiem.aspx?active=2&id=nhapdiem");
                    break;
                case "KHOASO":
                    window.location.assign("../Daotao/khoa_so.aspx?active=2&id=khoaso");
                    break;
                case "DIEM_CK":
                    window.location.assign("../Daotao/diem_cuoi_ky.aspx?active=2&id=diem_ck");
                    break;
                case "DIEM_CN":
                    window.location.assign("../Daotao/xet_duyet.aspx?active=2&id=diem_cn");
                    break;

                ///KTX
                case "NHAKTX":
                    window.location.assign("../KTX/Nha.aspx?active=3&id=nhaktx");
                    break;
                case "PHONGKTX":
                    window.location.assign("../KTX/Phong.aspx?active=3&id=phongktx");
                    break;
                case "DANGKYKTX":
                    window.location.assign("../KTX/Dang_ky.aspx?active=3&id=dangkyktx");
                    break;

                    //NHAN SU
                case "NHANSUEXEL":
                    window.location.assign("../Import/ImportNhanSu.aspx?active=4&id=nhansuexcel");
                    break;

                    //SINH VIEN
                case "KHENTHUONG":
                    window.location.assign("../SinhVien/khen_thuong.aspx?active=5&id=khen_thuong");
                    break;
                case "SINHVIENEXCEL":
                    window.location.assign("../SinhVien/ImportSinhVien.aspx?active=5&id=sinhvienexcel");
                    break;
            }
        }
        catch (e) {
            ShowError("Thông báo", e.message, "error");
        }
    }


    //$.event.special.hoverintent = {
    //    setup: function () {
    //        $(this).bind("mouseover", jQuery.event.special.hoverintent.handler);
    //    },
    //    teardown: function () {
    //        $(this).unbind("mouseover", jQuery.event.special.hoverintent.handler);
    //    },
    //    handler: function (event) {
    //        var currentX, currentY, timeout,
    //          args = arguments,
    //          target = $(event.target),
    //          previousX = event.pageX,
    //          previousY = event.pageY;

    //        function track(event) {
    //            currentX = event.pageX;
    //            currentY = event.pageY;
    //        };

    //        function clear() {
    //            target
    //              .unbind("mousemove", track)
    //              .unbind("mouseout", clear);
    //            clearTimeout(timeout);
    //        }

    //        function handler() {
    //            var prop,
    //              orig = event;

    //            if ((Math.abs(previousX - currentX) +
    //                Math.abs(previousY - currentY)) < 7) {
    //                clear();

    //                event = $.Event("hoverintent");
    //                for (prop in orig) {
    //                    if (!(prop in event)) {
    //                        event[prop] = orig[prop];
    //                    }
    //                }
    //                delete event.originalEvent;

    //                target.trigger(event);
    //            } else {
    //                previousX = currentX;
    //                previousY = currentY;
    //                timeout = setTimeout(handler, 100);
    //            }
    //        }

    //        timeout = setTimeout(handler, 100);
    //        target.bind({
    //            mousemove: track,
    //            mouseout: clear
    //        });
    //    }
    //};
</script>
